package com.xnfh.equipment.viewmodel.base

import com.xnfh.common.bean.EquipmentToken
import com.xnfh.common.bean.EquipmentTokenV1
import com.xnfh.framework.base.BaseViewModel
import com.xnfh.framework.bean.RespStateData

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2023/12/27 14:20
 * @UpdateUser: ziheng
 * @UpdateDate: 2023/12/27 14:20
 * @UpdateRemark: 更新说明
 */
open class BaseTokenViewModel: BaseViewModel(){

    private val baseViewModel = BaseTokenViewModelRes()
    val tokenV1 = RespStateData<EquipmentTokenV1>()
    val tokenV2 = RespStateData<EquipmentToken>()
    /**
     * 获取V1的token
     */
    fun requestKcTokenV1() = launch {
        baseViewModel.requestKcTokenV1(tokenV1)
    }

    /**
     * 获取V2的token
     */
    fun requestKcTokenV2() = launch {
        baseViewModel.requestKcTokenV2(tokenV2)
    }
}